﻿@inherits TscComponentBase

<DefaultDialog Value=Visible ValueChanged=UpdateVisible Title="@I18n.Dashboard("Update dashboard")">
    <ChildContent>
        <MForm @ref="Form" Model=Dashboard EnableValidation EnableI18n>
            <STextField Required @bind-Value="@Dashboard.Name" Class="mb-6" />
            <FolderSelect @bind-Value="Dashboard.Folder" Class="mb-6" />
            <LayerSelect @bind-Value="Dashboard.Layer" Class="mb-6" />
            <EnumSelect TValue="ModelTypes" @bind-Value="Dashboard.Model" Disabled Clearable=false Class="mb-6" Label="@I18n.Dashboard("Model")" />           
            <STextField Type="number" TValue="int" @bind-Value="Dashboard.Order" Label="@I18n.Dashboard("Order")" />
        </MForm>
    </ChildContent>
    <FooterContent>
        <div class="d-flex">
            <SCheckbox @bind-Value="Dashboard.IsRoot" Label="@I18n.Dashboard("Set as root")" Class="my-auto" Style="display:none" />
            <MSpacer />
            <SButton Large OnClick="UpdatetDashboardAsync" Width="140" Style="min-width:140px !important;" Class="my-auto">@I18n.T("Save")</SButton>
        </div>       
    </FooterContent>
</DefaultDialog>
